package com.cnaaa.xinqiao.vo;

import com.cnaaa.xinqiao.entity.Member;
import lombok.Data;
import org.springframework.beans.BeanUtils;

/**
 * 2018/10/19 Create by 郭文梁
 * MemberVo
 * 用户ValueObject避免直接将Entity返回到前端
 *
 * @author 郭文梁
 * @date 2018/10/19
 */
@Data
public class MemberVo {
    /**
     * 从Member对象创建MemberVo
     *
     * @param member Member对象
     * @return MemberVo
     */
    public static MemberVo of(Member member) {
        MemberVo vo = new MemberVo();
        BeanUtils.copyProperties(member, vo);
        return vo;
    }

    private Integer uid;
    private String nickname;
}
